import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
    {
        path: '/',
        name: '/',
        redirect:'/wiki_index'
    },
    {
        path: '/login',
        name: 'Login',
        component: () => import('../views/Login/Login.vue'),
    },
    {
        path: '/wiki_index',
        name: 'IndexWiki',
        component: () => import('../views/IndexWiki/IndexWiki.vue'),
    },
    {
        path: '/wiki_detail',
        name: 'WikiDetail',
        component: () => import('../views/WikiDetail/WikiDetail.vue'),
    },
    // 上面路由path之外的url
    {
        path: '*',
        name: 'IndexWiki',
        component: () => import('../views/IndexWiki/IndexWiki.vue'),
    },
];

const router = new VueRouter({
    mode: 'history',
    base: process.env.BASE_URL,
    routes
});

export default router;